package com.jiangyao.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 用户登录日志
 * </p>
 *
 * @author yangyongchuan
 * @since 2020-08-13
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class LoginLog extends Model<LoginLog> {
	private static final long serialVersionUID = 402920682274686524L;

	@TableId(value = "id", type = IdType.AUTO)
	private Long id;

	/**
	 * 用户类型 1：后台用户，2：前台用户
	 */
	private Integer userType;

	/**
	 * 用户ID
	 */
	private Integer userId;

	/**
	 * 登录凭证token
	 */
	private String token;

	/**
	 * 访问请求user_agent
	 */
	private String requestUserAgent;

	/**
	 * 登录IP
	 */
	private String loginIp;

	/**
	 * 登录时间
	 */
	private Date loginTime;


	@Override
	protected Serializable pkVal() {
		return this.id;
	}

}
